USE [master]
GO
/****** Object:  Database [RpcExtendService]    Script Date: 2022/11/12 15:49:08 ******/
CREATE DATABASE [RpcExtendService]
 CONTAINMENT = NONE
 ON  PRIMARY 
( NAME = N'RpcExtendService', FILENAME = N'E:\数据库\RpcExtendService.mdf' , SIZE = 73728KB , MAXSIZE = UNLIMITED, FILEGROWTH = 5%)
 LOG ON 
( NAME = N'RpcExtendService_log', FILENAME = N'E:\数据库\RpcExtendService_log.ldf' , SIZE = 139264KB , MAXSIZE = 2048GB , FILEGROWTH = 6%)
 WITH CATALOG_COLLATION = DATABASE_DEFAULT
GO
ALTER DATABASE [RpcExtendService] SET COMPATIBILITY_LEVEL = 130
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [RpcExtendService].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [RpcExtendService] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [RpcExtendService] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [RpcExtendService] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [RpcExtendService] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [RpcExtendService] SET ARITHABORT OFF 
GO
ALTER DATABASE [RpcExtendService] SET AUTO_CLOSE OFF 
GO
ALTER DATABASE [RpcExtendService] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [RpcExtendService] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [RpcExtendService] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [RpcExtendService] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [RpcExtendService] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [RpcExtendService] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [RpcExtendService] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [RpcExtendService] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [RpcExtendService] SET  DISABLE_BROKER 
GO
ALTER DATABASE [RpcExtendService] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO
ALTER DATABASE [RpcExtendService] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO
ALTER DATABASE [RpcExtendService] SET TRUSTWORTHY OFF 
GO
ALTER DATABASE [RpcExtendService] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO
ALTER DATABASE [RpcExtendService] SET PARAMETERIZATION SIMPLE 
GO
ALTER DATABASE [RpcExtendService] SET READ_COMMITTED_SNAPSHOT OFF 
GO
ALTER DATABASE [RpcExtendService] SET HONOR_BROKER_PRIORITY OFF 
GO
ALTER DATABASE [RpcExtendService] SET RECOVERY SIMPLE 
GO
ALTER DATABASE [RpcExtendService] SET  MULTI_USER 
GO
ALTER DATABASE [RpcExtendService] SET PAGE_VERIFY CHECKSUM  
GO
ALTER DATABASE [RpcExtendService] SET DB_CHAINING OFF 
GO
ALTER DATABASE [RpcExtendService] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) 
GO
ALTER DATABASE [RpcExtendService] SET TARGET_RECOVERY_TIME = 60 SECONDS 
GO
ALTER DATABASE [RpcExtendService] SET DELAYED_DURABILITY = DISABLED 
GO
ALTER DATABASE [RpcExtendService] SET ACCELERATED_DATABASE_RECOVERY = OFF  
GO
EXEC sys.sp_db_vardecimal_storage_format N'RpcExtendService', N'ON'
GO
ALTER DATABASE [RpcExtendService] SET QUERY_STORE = OFF
GO
USE [RpcExtendService]
GO
/****** Object:  Table [dbo].[AccreditToken]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AccreditToken](
	[AccreditId] [uniqueidentifier] NOT NULL,
	[PAccreditId] [uniqueidentifier] NULL,
	[AccreditRole] [varchar](1000) NOT NULL,
	[ApplyId] [varchar](50) NOT NULL,
	[CheckKey] [varchar](50) NOT NULL,
	[RoleType] [varchar](50) NOT NULL,
	[State] [nvarchar](1000) NOT NULL,
	[StateVer] [int] NOT NULL,
	[RpcMerId] [bigint] NOT NULL,
	[SysGroup] [varchar](50) NOT NULL,
	[SystemType] [varchar](50) NOT NULL,
	[Expire] [smalldatetime] NULL,
	[OverTime] [smalldatetime] NOT NULL,
	[AddTime] [smalldatetime] NOT NULL,
 CONSTRAINT [PK_AccreditToken] PRIMARY KEY CLUSTERED 
(
	[AccreditId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[AutoTaskItem]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AutoTaskItem](
	[Id] [uniqueidentifier] NOT NULL,
	[TaskId] [uniqueidentifier] NOT NULL,
	[ItemTitle] [nvarchar](50) NOT NULL,
	[ItemSort] [int] NOT NULL,
	[SendType] [tinyint] NOT NULL,
	[SendParam] [nvarchar](max) NOT NULL,
	[TimeOut] [int] NULL,
	[RetryNum] [smallint] NULL,
	[FailSetup] [tinyint] NOT NULL,
	[FailNextSetup] [int] NULL,
	[SuccessSetup] [tinyint] NOT NULL,
	[NextSetup] [int] NULL,
	[LogRange] [tinyint] NOT NULL,
	[IsSuccess] [bit] NOT NULL,
	[ErrorCode] [bigint] NULL,
	[IsEnable] [bit] NOT NULL,
	[LastExecTime] [smalldatetime] NULL,
 CONSTRAINT [PK_AutoTaskItem] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[AutoTaskList]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AutoTaskList](
	[Id] [uniqueidentifier] NOT NULL,
	[RegionId] [int] NOT NULL,
	[TaskName] [nvarchar](50) NOT NULL,
	[TaskShow] [nvarchar](255) NOT NULL,
	[TaskPriority] [int] NOT NULL,
	[BeginItem] [smallint] NOT NULL,
	[FailEmall] [varchar](1000) NULL,
	[VerNum] [int] NOT NULL,
	[IsExec] [bit] NOT NULL,
	[ExecVerNum] [int] NOT NULL,
	[LastExecTime] [datetime] NULL,
	[LastExecEndTime] [datetime] NULL,
	[NextExecTime] [datetime] NULL,
	[IsEnable] [bit] NOT NULL,
 CONSTRAINT [PK_AutoTaskList] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[AutoTaskLog]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AutoTaskLog](
	[Id] [uniqueidentifier] NOT NULL,
	[TaskId] [uniqueidentifier] NOT NULL,
	[ItemId] [uniqueidentifier] NOT NULL,
	[IsFail] [bit] NOT NULL,
	[ErrorId] [bigint] NULL,
	[BeginTime] [datetime] NOT NULL,
	[EndTime] [datetime] NOT NULL,
	[Result] [nvarchar](1000) NULL,
 CONSTRAINT [PK_AutoTaskLog] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[AutoTaskPlan]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AutoTaskPlan](
	[Id] [uniqueidentifier] NOT NULL,
	[TaskId] [uniqueidentifier] NOT NULL,
	[PlanTitle] [nvarchar](50) NOT NULL,
	[PlanType] [tinyint] NOT NULL,
	[ExecTime] [datetime] NULL,
	[ExecRate] [tinyint] NOT NULL,
	[ExecSpace] [smallint] NULL,
	[SpaceType] [tinyint] NOT NULL,
	[SpaceDay] [smallint] NULL,
	[SpeceNum] [tinyint] NULL,
	[SpaceWeek] [smallint] NULL,
	[DayRate] [tinyint] NOT NULL,
	[DayTimeSpan] [int] NULL,
	[DaySpaceType] [tinyint] NOT NULL,
	[DaySpaceNum] [int] NULL,
	[DayBeginSpan] [int] NULL,
	[DayEndSpan] [int] NULL,
	[BeginDate] [date] NOT NULL,
	[EndDate] [date] NULL,
	[PlanOnlyNo] [varchar](32) NULL,
	[ErrorCode] [bigint] NULL,
	[IsEnable] [bit] NOT NULL,
 CONSTRAINT [PK_AutoTaskPlan] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BroadcastErrorLog]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BroadcastErrorLog](
	[Id] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
	[ErrorId] [bigint] NOT NULL,
	[MsgKey] [varchar](50) NOT NULL,
	[MsgBody] [ntext] NOT NULL,
	[ServerId] [bigint] NOT NULL,
	[SysTypeVal] [varchar](100) NOT NULL,
	[MsgSource] [varchar](max) NOT NULL,
	[BroadcastType] [smallint] NOT NULL,
	[RouteKey] [varchar](50) NOT NULL,
	[RpcMerId] [bigint] NOT NULL,
	[AddTime] [smalldatetime] NOT NULL,
 CONSTRAINT [PK_BroadcastErrorLog] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[DictateNode]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DictateNode](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[ParentId] [bigint] NOT NULL,
	[Dictate] [varchar](50) NOT NULL,
	[DictateName] [nvarchar](50) NOT NULL,
	[IsEndpoint] [bit] NOT NULL,
 CONSTRAINT [PK_DictateNode] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[DictateNodeRelation]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DictateNodeRelation](
	[SubId] [bigint] NOT NULL,
	[ParentId] [bigint] NOT NULL,
 CONSTRAINT [PK_DictateNodeRelation] PRIMARY KEY CLUSTERED 
(
	[SubId] ASC,
	[ParentId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[IdentityApp]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[IdentityApp](
	[Id] [uniqueidentifier] NOT NULL,
	[AppName] [nvarchar](50) NOT NULL,
	[AppShow] [nvarchar](255) NULL,
	[EffectiveDate] [date] NULL,
	[IsEnable] [bit] NOT NULL,
	[CreateTime] [smalldatetime] NOT NULL,
 CONSTRAINT [PK_IdentityApp] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[IdentityPrower]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[IdentityPrower](
	[Id] [uniqueidentifier] NOT NULL,
	[AppId] [uniqueidentifier] NOT NULL,
	[SystemType] [varchar](50) NOT NULL,
	[ResourceType] [smallint] NOT NULL,
	[Value] [varchar](100) NOT NULL,
 CONSTRAINT [PK_IdentityPrower] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Idgenerator]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Idgenerator](
	[ServerId] [bigint] NOT NULL,
	[WorkId] [int] NOT NULL,
	[SystemTypeId] [bigint] NOT NULL,
 CONSTRAINT [PK_Idgenerator_1] PRIMARY KEY CLUSTERED 
(
	[ServerId] ASC,
	[WorkId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[IpBlackList]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[IpBlackList](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[RpcMerId] [bigint] NOT NULL,
	[SystemType] [varchar](50) NOT NULL,
	[IpType] [tinyint] NOT NULL,
	[Ip6] [varchar](30) NOT NULL,
	[Ip] [bigint] NOT NULL,
	[EndIp] [bigint] NULL,
	[IsDrop] [bit] NOT NULL,
	[Remark] [nvarchar](50) NOT NULL,
 CONSTRAINT [PK_IpBlackList] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ResourceList]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ResourceList](
	[Id] [uniqueidentifier] NOT NULL,
	[ModularId] [uniqueidentifier] NOT NULL,
	[ResourcePath] [varchar](100) NOT NULL,
	[FullPath] [varchar](300) NOT NULL,
	[ResourceShow] [nvarchar](100) NOT NULL,
	[ResourceState] [smallint] NOT NULL,
	[VerNum] [bigint] NOT NULL,
	[ResourceVer] [int] NOT NULL,
	[LastTime] [date] NULL,
	[AddTime] [smalldatetime] NOT NULL,
 CONSTRAINT [PK_ResourceList] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ResourceModular]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ResourceModular](
	[Id] [uniqueidentifier] NOT NULL,
	[ModularKey] [varchar](32) NOT NULL,
	[RpcMerId] [bigint] NOT NULL,
	[SystemType] [varchar](50) NOT NULL,
	[ModularName] [nvarchar](50) NOT NULL,
	[Remark] [nvarchar](50) NULL,
	[ResourceType] [smallint] NOT NULL,
	[AddTime] [smalldatetime] NOT NULL,
 CONSTRAINT [PK_ResourceModular] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ResourceShield]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ResourceShield](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[ResourceId] [uniqueidentifier] NULL,
	[ShieKey] [varchar](36) NOT NULL,
	[RpcMerId] [bigint] NOT NULL,
	[SystemType] [varchar](50) NOT NULL,
	[ServerId] [bigint] NOT NULL,
	[ApiVerNum] [bigint] NOT NULL,
	[SortNum] [smallint] NOT NULL,
	[ResourcePath] [varchar](100) NOT NULL,
	[BeOverdueTime] [bigint] NOT NULL,
 CONSTRAINT [PK_ResourceShield] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[RpcTraceList]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[RpcTraceList](
	[Id] [uniqueidentifier] NOT NULL,
	[TraceId] [varchar](32) NOT NULL,
	[ServerName] [nvarchar](50) NOT NULL,
	[BeginTime] [datetime] NOT NULL,
	[EndTime] [datetime] NOT NULL,
	[Duration] [int] NOT NULL,
	[ServerId] [bigint] NOT NULL,
	[SystemType] [varchar](50) NOT NULL,
	[RegionId] [int] NOT NULL,
 CONSTRAINT [PK_RpcTraceList] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[RpcTraceLog]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[RpcTraceLog](
	[Id] [uniqueidentifier] NOT NULL,
	[TraceId] [varchar](32) NOT NULL,
	[SpanId] [bigint] NOT NULL,
	[ParentId] [bigint] NOT NULL,
	[ServerName] [nvarchar](50) NOT NULL,
	[Dictate] [varchar](100) NOT NULL,
	[ServerId] [bigint] NOT NULL,
	[SystemType] [varchar](50) NOT NULL,
	[RemoteId] [bigint] NOT NULL,
	[RegionId] [int] NOT NULL,
	[ReturnRes] [nvarchar](max) NOT NULL,
	[Args] [nvarchar](max) NOT NULL,
	[MsgType] [varchar](10) NULL,
	[StageType] [tinyint] NOT NULL,
	[BeginTime] [datetime] NOT NULL,
	[EndTime] [datetime] NOT NULL,
	[Duration] [int] NOT NULL,
 CONSTRAINT [PK_RpcTraceLog] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[SystemErrorLog]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SystemErrorLog](
	[Id] [uniqueidentifier] NOT NULL,
	[RpcMerId] [bigint] NOT NULL,
	[TraceId] [varchar](64) NOT NULL,
	[LogTitle] [nvarchar](200) NOT NULL,
	[LogShow] [nvarchar](2000) NOT NULL,
	[SystemType] [varchar](50) NOT NULL,
	[ServerId] [bigint] NOT NULL,
	[LogGroup] [varchar](50) NOT NULL,
	[LogType] [tinyint] NOT NULL,
	[LogGrade] [tinyint] NOT NULL,
	[ErrorCode] [varchar](200) NOT NULL,
	[Exception] [ntext] NOT NULL,
	[AttrList] [ntext] NOT NULL,
	[AddTime] [datetime] NOT NULL,
 CONSTRAINT [PK_SystemErrorLog] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TransactionList]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TransactionList](
	[Id] [uniqueidentifier] NOT NULL,
	[ParentId] [uniqueidentifier] NOT NULL,
	[RpcMerId] [bigint] NOT NULL,
	[ServerId] [bigint] NOT NULL,
	[SystemType] [varchar](50) NOT NULL,
	[RegionId] [int] NOT NULL,
	[TranName] [varchar](50) NOT NULL,
	[SubmitJson] [nvarchar](max) NOT NULL,
	[Extend] [nvarchar](500) NULL,
	[TranStatus] [tinyint] NOT NULL,
	[TranMode] [tinyint] NOT NULL,
	[IsRoot] [bit] NOT NULL,
	[IsLock] [bit] NOT NULL,
	[LockTime] [smalldatetime] NULL,
	[CommitStatus] [tinyint] NOT NULL,
	[OverTime] [smalldatetime] NOT NULL,
	[SubmitTime] [smalldatetime] NULL,
	[FailTime] [smalldatetime] NULL,
	[RetryNum] [smallint] NOT NULL,
	[ErrorId] [bigint] NOT NULL,
	[EndTime] [smalldatetime] NULL,
	[AddTime] [smalldatetime] NOT NULL,
 CONSTRAINT [PK_TransactionList] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_IdentityPrower]    Script Date: 2022/11/12 15:49:08 ******/
CREATE NONCLUSTERED INDEX [IX_IdentityPrower] ON [dbo].[IdentityPrower]
(
	[AppId] ASC,
	[SystemType] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
GO
/****** Object:  Index [IX_IdentityPrower_1]    Script Date: 2022/11/12 15:49:08 ******/
CREATE NONCLUSTERED INDEX [IX_IdentityPrower_1] ON [dbo].[IdentityPrower]
(
	[AppId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
GO
/****** Object:  Index [IX_Idgenerator]    Script Date: 2022/11/12 15:49:08 ******/
CREATE UNIQUE NONCLUSTERED INDEX [IX_Idgenerator] ON [dbo].[Idgenerator]
(
	[ServerId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
GO
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_IpBlackList]    Script Date: 2022/11/12 15:49:08 ******/
CREATE NONCLUSTERED INDEX [IX_IpBlackList] ON [dbo].[IpBlackList]
(
	[RpcMerId] ASC,
	[SystemType] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
GO
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_ResourceShield]    Script Date: 2022/11/12 15:49:08 ******/
CREATE UNIQUE NONCLUSTERED INDEX [IX_ResourceShield] ON [dbo].[ResourceShield]
(
	[ShieKey] ASC,
	[ResourcePath] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
GO
/****** Object:  Index [IX_ResourceShield_1]    Script Date: 2022/11/12 15:49:08 ******/
CREATE NONCLUSTERED INDEX [IX_ResourceShield_1] ON [dbo].[ResourceShield]
(
	[ResourceId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
GO
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_RpcTraceLog]    Script Date: 2022/11/12 15:49:08 ******/
CREATE NONCLUSTERED INDEX [IX_RpcTraceLog] ON [dbo].[RpcTraceLog]
(
	[TraceId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AccreditToken] ADD  CONSTRAINT [DF_AccreditToken_AddTime]  DEFAULT (getdate()) FOR [AddTime]
GO
ALTER TABLE [dbo].[AutoTaskItem] ADD  CONSTRAINT [DF_AutoTaskItem_IsWriteLog]  DEFAULT ((2)) FOR [LogRange]
GO
ALTER TABLE [dbo].[AutoTaskItem] ADD  CONSTRAINT [DF_AutoTaskItem_IsSuccess]  DEFAULT ((0)) FOR [IsSuccess]
GO
ALTER TABLE [dbo].[AutoTaskList] ADD  CONSTRAINT [DF_AutoTaskList_TaskPriority]  DEFAULT ((0)) FOR [TaskPriority]
GO
ALTER TABLE [dbo].[AutoTaskList] ADD  CONSTRAINT [DF_AutoTaskList_BeginItem]  DEFAULT ((0)) FOR [BeginItem]
GO
ALTER TABLE [dbo].[AutoTaskList] ADD  CONSTRAINT [DF_AutoTaskList_VerNum]  DEFAULT ((0)) FOR [VerNum]
GO
ALTER TABLE [dbo].[AutoTaskList] ADD  CONSTRAINT [DF_AutoTaskList_ExecStatus]  DEFAULT ((0)) FOR [IsExec]
GO
ALTER TABLE [dbo].[AutoTaskList] ADD  CONSTRAINT [DF_AutoTaskList_ExecVerNum]  DEFAULT ((0)) FOR [ExecVerNum]
GO
ALTER TABLE [dbo].[AutoTaskList] ADD  CONSTRAINT [DF_AutoTaskList_IsEnable]  DEFAULT ((0)) FOR [IsEnable]
GO
ALTER TABLE [dbo].[AutoTaskPlan] ADD  CONSTRAINT [DF_AutoTaskPlan_ExecRate]  DEFAULT ((0)) FOR [ExecRate]
GO
ALTER TABLE [dbo].[AutoTaskPlan] ADD  CONSTRAINT [DF_AutoTaskPlan_SpaceType]  DEFAULT ((0)) FOR [SpaceType]
GO
ALTER TABLE [dbo].[AutoTaskPlan] ADD  CONSTRAINT [DF_AutoTaskPlan_DayRate]  DEFAULT ((0)) FOR [DayRate]
GO
ALTER TABLE [dbo].[AutoTaskPlan] ADD  CONSTRAINT [DF_AutoTaskPlan_DaySpaceType]  DEFAULT ((0)) FOR [DaySpaceType]
GO
ALTER TABLE [dbo].[BroadcastErrorLog] ADD  CONSTRAINT [DF_BroadcastErrorLog_Id]  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[BroadcastErrorLog] ADD  CONSTRAINT [DF_BroadcastErrorLog_RpcMerId]  DEFAULT ((0)) FOR [RpcMerId]
GO
ALTER TABLE [dbo].[IdentityApp] ADD  CONSTRAINT [DF_IdentityApp_CreateTime]  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[IpBlackList] ADD  CONSTRAINT [DF_IpBlackList_IpType]  DEFAULT ((0)) FOR [IpType]
GO
ALTER TABLE [dbo].[IpBlackList] ADD  CONSTRAINT [DF_IpBlackList_Ip6]  DEFAULT ((0)) FOR [Ip6]
GO
ALTER TABLE [dbo].[IpBlackList] ADD  CONSTRAINT [DF_IpBlackList_IsDrop]  DEFAULT ((0)) FOR [IsDrop]
GO
ALTER TABLE [dbo].[ResourceList] ADD  CONSTRAINT [DF_ResourceList_ResourceState]  DEFAULT ((1)) FOR [ResourceState]
GO
ALTER TABLE [dbo].[ResourceList] ADD  CONSTRAINT [DF_ResourceList_VerNum]  DEFAULT ((0)) FOR [VerNum]
GO
ALTER TABLE [dbo].[ResourceList] ADD  CONSTRAINT [DF_ResourceList_ResourceVer]  DEFAULT ((0)) FOR [ResourceVer]
GO
ALTER TABLE [dbo].[ResourceList] ADD  CONSTRAINT [DF_ResourceList_AddTime]  DEFAULT (getdate()) FOR [AddTime]
GO
ALTER TABLE [dbo].[ResourceModular] ADD  CONSTRAINT [DF_ResourceModular_AddTime]  DEFAULT (getdate()) FOR [AddTime]
GO
ALTER TABLE [dbo].[ResourceShield] ADD  CONSTRAINT [DF_ResourceShield_ServerId]  DEFAULT ((0)) FOR [ServerId]
GO
ALTER TABLE [dbo].[ResourceShield] ADD  CONSTRAINT [DF_ResourceShield_VerNum]  DEFAULT ((0)) FOR [ApiVerNum]
GO
ALTER TABLE [dbo].[TransactionList] ADD  CONSTRAINT [DF_TransactionList_RegionId]  DEFAULT ((0)) FOR [RegionId]
GO
ALTER TABLE [dbo].[TransactionList] ADD  CONSTRAINT [DF_TransactionList_IsLock]  DEFAULT ((0)) FOR [IsLock]
GO
ALTER TABLE [dbo].[TransactionList] ADD  CONSTRAINT [DF_TransactionList_IsCommit]  DEFAULT ((0)) FOR [CommitStatus]
GO
ALTER TABLE [dbo].[TransactionList] ADD  CONSTRAINT [DF_TransactionList_RetryNum]  DEFAULT ((0)) FOR [RetryNum]
GO
ALTER TABLE [dbo].[TransactionList] ADD  CONSTRAINT [DF_TransactionList_ErrorCode]  DEFAULT ((0)) FOR [ErrorId]
GO
/****** Object:  StoredProcedure [dbo].[RegError]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[RegError]
@Code varchar(50)
as
	declare @ErrorId bigint=0,@IsPerfect bit=0;
	select @ErrorId=Id,@IsPerfect=IsPerfect from ErrorCollect(nolock) where ErrorCode=@Code
	if(@@rowcount !=0)
	begin
		select @ErrorId as ErrorId,@IsPerfect as IsPerfect
	end
	else
	begin
		insert into ErrorCollect(ErrorCode)values(@Code)
		select SCOPE_IDENTITY() as ErrorId,@IsPerfect as IsPerfect
	end
GO
/****** Object:  StoredProcedure [dbo].[ServerOffline]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[ServerOffline]
@Id bigint,
@IsOffline bit output,
@Res bit output
as
	set @IsOffline=0;
	update RemoteServerConfig with(rowlock) set IsOnline=0 where Id=@Id and IsOnline=1
	if(@@rowcount >0)
	begin
		set @IsOffline=1;
		set @Res=1;
	end 
GO
/****** Object:  StoredProcedure [dbo].[ServerOnline]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[ServerOnline]
@Id bigint,
@Index int,
@IsOneOnline bit output,
@Res bit output
as
	set @Res=0;
	set @IsOneOnline=0;
	update RemoteServerConfig with(rowlock) set IsOnline=1,BindIndex=@Index where Id=@Id and IsOnline=0
	if(@@rowcount >0)
	begin
		set @Res=1;
		set @IsOneOnline=1;
	end 
GO
/****** Object:  StoredProcedure [dbo].[SyncError]    Script Date: 2022/11/12 15:49:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[SyncError]
@Code varchar(50),
@ErrorId bigint output,
@Res bit output
as
	set @Res=0;
	set @ErrorId=0;
	select @ErrorId=Id from ErrorCollect(nolock) where ErrorCode=@Code
	if(@@rowcount !=0)
	begin
		set @Res=1;
		select Lang,Msg from ErrorLangMsg(nolock) where ErrorId=@ErrorId
	end
	else
	begin
		insert into ErrorCollect(ErrorCode)values(@Code)
		set @ErrorId=SCOPE_IDENTITY();
		if(@ErrorId !=0)
		begin
			set @Res=1;
		end
	end
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'任务名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AutoTaskList', @level2type=N'COLUMN',@level2name=N'TaskName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'版本号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AutoTaskList', @level2type=N'COLUMN',@level2name=N'VerNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自动任务信息表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AutoTaskList'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'任务类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AutoTaskPlan', @level2type=N'COLUMN',@level2name=N'PlanType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'任务执行间隔' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AutoTaskPlan', @level2type=N'COLUMN',@level2name=N'DayTimeSpan'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'错误Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BroadcastErrorLog', @level2type=N'COLUMN',@level2name=N'ErrorId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息指令' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BroadcastErrorLog', @level2type=N'COLUMN',@level2name=N'MsgKey'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息体' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BroadcastErrorLog', @level2type=N'COLUMN',@level2name=N'MsgBody'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'服务节点Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BroadcastErrorLog', @level2type=N'COLUMN',@level2name=N'ServerId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'节点类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BroadcastErrorLog', @level2type=N'COLUMN',@level2name=N'SysTypeVal'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息来源' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BroadcastErrorLog', @level2type=N'COLUMN',@level2name=N'MsgSource'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发送的集群Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BroadcastErrorLog', @level2type=N'COLUMN',@level2name=N'RpcMerId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BroadcastErrorLog', @level2type=N'COLUMN',@level2name=N'AddTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'广播错误日志表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BroadcastErrorLog'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'父指令Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DictateNode', @level2type=N'COLUMN',@level2name=N'ParentId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'指令' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DictateNode', @level2type=N'COLUMN',@level2name=N'Dictate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'指令名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DictateNode', @level2type=N'COLUMN',@level2name=N'DictateName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否为终节点' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DictateNode', @level2type=N'COLUMN',@level2name=N'IsEndpoint'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'指令路由节点表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DictateNode'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'应用标识' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IdentityApp', @level2type=N'COLUMN',@level2name=N'Id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'应用名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IdentityApp', @level2type=N'COLUMN',@level2name=N'AppName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'说明' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IdentityApp', @level2type=N'COLUMN',@level2name=N'AppShow'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'有效期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IdentityApp', @level2type=N'COLUMN',@level2name=N'EffectiveDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否启用' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IdentityApp', @level2type=N'COLUMN',@level2name=N'IsEnable'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IdentityApp', @level2type=N'COLUMN',@level2name=N'CreateTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'应用ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IdentityPrower', @level2type=N'COLUMN',@level2name=N'AppId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'系列类别Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IdentityPrower', @level2type=N'COLUMN',@level2name=N'SystemType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'资源类型 2 网关API 4 RPC消息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IdentityPrower', @level2type=N'COLUMN',@level2name=N'ResourceType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'资源路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'IdentityPrower', @level2type=N'COLUMN',@level2name=N'Value'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所属模块' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ResourceList', @level2type=N'COLUMN',@level2name=N'ModularId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'资源路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ResourceList', @level2type=N'COLUMN',@level2name=N'ResourcePath'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'完整路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ResourceList', @level2type=N'COLUMN',@level2name=N'FullPath'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'资源说明' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ResourceList', @level2type=N'COLUMN',@level2name=N'ResourceShow'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'资源状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ResourceList', @level2type=N'COLUMN',@level2name=N'ResourceState'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'资源版本' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ResourceList', @level2type=N'COLUMN',@level2name=N'ResourceVer'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最后更新日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ResourceList', @level2type=N'COLUMN',@level2name=N'LastTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ResourceList', @level2type=N'COLUMN',@level2name=N'AddTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模块Key 唯一标识' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ResourceModular', @level2type=N'COLUMN',@level2name=N'ModularKey'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'集群Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ResourceModular', @level2type=N'COLUMN',@level2name=N'RpcMerId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'系统类型Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ResourceModular', @level2type=N'COLUMN',@level2name=N'SystemType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模块名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ResourceModular', @level2type=N'COLUMN',@level2name=N'ModularName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'资源类型 2 网关API 4 RPC消息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ResourceModular', @level2type=N'COLUMN',@level2name=N'ResourceType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'微秒' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'RpcTraceLog', @level2type=N'COLUMN',@level2name=N'Duration'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'集群Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemErrorLog', @level2type=N'COLUMN',@level2name=N'RpcMerId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链路Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemErrorLog', @level2type=N'COLUMN',@level2name=N'TraceId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日志标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemErrorLog', @level2type=N'COLUMN',@level2name=N'LogTitle'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日志说明' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemErrorLog', @level2type=N'COLUMN',@level2name=N'LogShow'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类别Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemErrorLog', @level2type=N'COLUMN',@level2name=N'SystemType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'服务节点Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemErrorLog', @level2type=N'COLUMN',@level2name=N'ServerId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日志组' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemErrorLog', @level2type=N'COLUMN',@level2name=N'LogGroup'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日志类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemErrorLog', @level2type=N'COLUMN',@level2name=N'LogType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日志等级' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemErrorLog', @level2type=N'COLUMN',@level2name=N'LogGrade'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'错误码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemErrorLog', @level2type=N'COLUMN',@level2name=N'ErrorCode'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'错误信息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemErrorLog', @level2type=N'COLUMN',@level2name=N'Exception'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日志属性列表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemErrorLog', @level2type=N'COLUMN',@level2name=N'AttrList'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemErrorLog', @level2type=N'COLUMN',@level2name=N'AddTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'系统错误日志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemErrorLog'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'事务Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'Id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'父级事务Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'ParentId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发起集群Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'RpcMerId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'服务节点Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'ServerId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'节点类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'SystemType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所属机房Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'RegionId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'事务名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'TranName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'提交的数据' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'SubmitJson'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'扩展数据' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'Extend'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'事务状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'TranStatus'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否是注册的事务' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'TranMode'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否锁定' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'IsLock'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'过期时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'OverTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'结束时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'SubmitTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'失败时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'FailTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'重试次数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'RetryNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'错误ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'ErrorId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList', @level2type=N'COLUMN',@level2name=N'AddTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'事务信息表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TransactionList'
GO
USE [master]
GO
ALTER DATABASE [RpcExtendService] SET  READ_WRITE 
GO
